package com.sitechasia.webx.components.xtable.toolbar;

import org.extremecomponents.table.core.TableModel;
import org.extremecomponents.table.view.html.BuilderUtils;

import org.extremecomponents.util.HtmlBuilder;

/**
 * @author Jeff Johnston
 */
public class CustomdivSSI18nToolbar extends DivLayout{


	public CustomdivSSI18nToolbar(HtmlBuilder html, TableModel model) {
		super(html, model);
	}
	protected boolean showLayout(TableModel model) {
        boolean showPagination = BuilderUtils.showPagination(model);
        boolean showExports = BuilderUtils.showExports(model);
        if (!showPagination && !showExports) {
            return false;
        }

        return true;
    }

	public void divToolbar(HtmlBuilder html, TableModel model) {
		CustomToolbarI18nBuilder toolbarBuilder = new CustomToolbarI18nBuilder(html,
				model);

		html.div().styleClass("page").close();
		// 显示： # 条/页
		html.span().styleClass("pageright").close();
		toolbarBuilder.customRowsDisplayedDroplist();
		html.spanEnd();
		// 显示：上一页
		toolbarBuilder.prevPageItemAsText();
		html.nbsp();
		// 显示：1 2 3 4 5 页
		toolbarBuilder.displayPages();
		// 显示：下一页
		toolbarBuilder.nextPageItemAsText();
		html.nbsp();
		// 显示：跳转到第#页
		toolbarBuilder.turnToPage();
		// 显示：共有150条
		toolbarBuilder.totalRows();

		html.divEnd();

		html.newline();
	}

}